package net.oschina.app.com.oschina.pages;

import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import junit.framework.Assert;

import net.oschina.app.SoloWrap;

/**
 * Created by Administrator on 2017/1/5.
 */

public class LoginPage {

    private SoloWrap solo;
    private ImageView settingIV,iconIV;
    private LinearLayout message,blog,avtivities,team;
    private TextView nickName;
    private LinearLayout follower;

    public LoginPage(SoloWrap solo){
        this.solo = solo;
    }

    public void initViews(){
        settingIV = (ImageView) solo.getView("net.oschina.app:id/iv_logo_setting");
        iconIV = (ImageView) solo.getView("net.oschina.app:id/iv_portrait");
        message = (LinearLayout) solo.getView("net.oschina.app:id/rl_message");
        blog = (LinearLayout) solo.getView("net.oschina.app:id/rl_blog");
        avtivities = (LinearLayout) solo.getView("net.oschina.app:id/rl_info_avtivities");
        team = (LinearLayout) solo.getView("net.oschina.app:id/rl_team");
        nickName = (TextView) solo.getView("net.oschina.app:id/tv_nick");
        follower = (LinearLayout) solo.getView("net.oschina.app:id/ly_follower");
    }

    public void clickSettings(){
        solo.clickOnView(settingIV);
    }

    public void clickIcon(){
        solo.clickOnView(iconIV);
    }

    public void clickMess(){
        solo.clickOnView(message);
    }

    public void clickBlog(){
        solo.clickOnView(blog);
    }

    public void clickActivity(){
        solo.clickOnView(avtivities);
    }

    public void clickTeam(){
        solo.clickOnView(team);
    }

    public String getNick(){
        String name = nickName.getText().toString();
        return name;
    }

    public Boolean isLogined(String name){
        return getNick().equals(name);
    }

    public void clickFollower(){
        solo.clickOnView(follower);
    }





}
